home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / editor / flyerlapse.rexx < prev    next >
OS/2 REXX Batch file  |  1996-03-07  |  4KB  |  163 lines

  1. /* FlyLapse.rexx -- Record frames to a Flyer clip at intervals.  */
  2. /* By Arnie Cachelin © 1992 NewTek Inc.                          */
  3. /* 4.0'ised by Bob Caron, Flyer versioned by Arnie again.        */
  4. /* And yet again by Bob Caron. (We just couldn't put this down.) */
  5. /* Current version By Bob Caron (Grue) © 1995 NewTek Inc.        */
  6.  
  7. OPTIONS RESULTS
  8. call remlib('ToasterARexx.port')
  9. call remlib('PROJECT_REXX_PORT')
  10.  
  11. call addlib('PROJECT_REXX_PORT' , 0)
  12. call addlib('ToasterARexx.port',0)
  13.  
  14. call set_view(2)
  15. call req_error("Flyer TimeLapse V3.0     ---     Record frames to a Flyer clip at intervals.")
  16.  
  17. drive="FA0:"
  18. clip="TimeLapse"
  19. num=1
  20. do while exists(drive||clip||num)
  21.    num=num+1
  22.    end
  23.  
  24. rx startfilereq("Save Clip Where?",drive,clip||num)
  25.  
  26. exit=1
  27. do while exit=1
  28.   file=queryfilereq()
  29.   if file=0 then call quit
  30.   if file~="" then exit=0
  31.   address command "c:wait 1"
  32. end
  33.  
  34. if exists(file) then
  35.    if req_tell("Ok to append to that clip?")=0 then call quit
  36.  
  37. if lastpos('/',file,length(file)-1)~=0 then do
  38.    filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
  39.    path=left(file,(lastpos('/',file,length(file))-1))
  40.    end
  41. else do
  42.    filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
  43.    path=left(file,(lastpos(':',file,length(file))))
  44.    end
  45.  
  46. call pragma("D",path)
  47. path=pragma("D","RAM:")
  48.  
  49. file=path||filenam
  50.  
  51. call req_error("This is the delay interval between grabs.       (30 Frames = 1 second delay)")
  52.  
  53. delay=0
  54. do while(delay<1)
  55.    delay=req_number("Delay In Frames",'30')
  56.    if delay="CANCEL" then call quit
  57.    end
  58.  
  59. call req_error("Example: 150 frames = 5 seconds.")
  60.  
  61. count=0
  62. do while(count<1)
  63.    count=req_number("Number Of Frames To Grab",150)
  64.    if count=0 then call quit
  65.    if count="CANCEL" then call quit
  66.    end
  67.  
  68.  
  69. call req_error("Note: HQ-5 selection will only work if HQ-5 is turned on in the options panel.")
  70.  
  71. compression=-1
  72. buttons='000'
  73. do while compression=-1
  74.   buttons=req_buttons("Choose Compression:",buttons,"HQ-5","Standard","Extended")
  75.   if buttons="CANCEL" then call quit
  76.  
  77.   if buttons="100" then do
  78.      compression=3
  79.      end
  80.   if buttons="010" then do
  81.      compression=0
  82.      end
  83.   if buttons="001" then do
  84.      compression=1
  85.      end
  86. end
  87.  
  88. vidinput="-1"
  89. buttons='1000'
  90. do while vidinput="-1"
  91.   buttons=req_buttons("Choose Input:",buttons,"Main 1","Main 2","Main 3","Main 4")
  92.   if buttons="CANCEL" then call quit
  93.   if buttons="1000" then do
  94.      vidinput="001"
  95.      end
  96.   if buttons="0100" then do
  97.      vidinput="002"
  98.      end
  99.   if buttons="0010" then do
  100.      vidinput="003"
  101.      end
  102.   if buttons="0001" then do
  103.      vidinput="004"
  104.      end
  105. end
  106.  
  107. if count="" then count=10
  108. if req_tell("Click 'Continue' to begin.")=0 then call quit
  109.  
  110. call req_error("")
  111.  
  112. call req_open("Working.... Please wait.")
  113.  
  114. Switcher(M||vidinput)
  115. Switcher(P||vidinput)
  116. if ~exists("toaster:programs/flyer_support/c/setplaymode") then do
  117.    call req_tell("Error:","I am missing the program","'SetPlayMode' in your","Programs/Flyer_Support/c directory")
  118.    call quit()
  119.    end
  120. if ~exists("toaster:programs/flyer_support/c/AppendFields") then do
  121.    call req_tell("Error:","I am missing the program","'AppendFields' in your","Programs/Flyer_Support/c directory")
  122.    call quit()
  123.    end
  124. address command "toaster:programs/flyer_support/c/setplaymode 0 REC"
  125. do f=0 to count
  126.   address command "toaster:programs/flyer_support/c/appendfields "||file||" 2 "compression" >env:output"
  127.   open(state, "env:output", R)
  128.   null=readln(state)
  129.   if left(readln(state),8)="Error 33" then do
  130.     address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
  131.     call req_tell("Error:","        Your flyer drive is Full!")
  132.     call req_close()
  133.     call quit()
  134.     end
  135.   call close state
  136.   call req_error("TimeLapse:  Current Frame ("||f||")   Frames to go ("||count-f||")   Delay ("||delay||")")
  137.   Switcher(FRES)      /* Reset frame counter */
  138.   Switcher(WAIT,delay) /* address command "c:wait "||delay */
  139.   end
  140. address command "toaster:programs/flyer_support/c/setplaymode 0 PLAY"
  141. call req_close()
  142.  
  143. call req_error("")
  144. icontime=REQ_FLYERJOG("Choose frame for icon.",file,1)
  145. if icontime="CANCEL" then call quit()
  146. icontime=icontime*2
  147. call MAKEICON(file,icontime)
  148.  
  149. call req_error("All done.")
  150. call req_error("")
  151. call req_close()
  152. call remlib('ToasterARexx.port')
  153. call remlib('PROJECT_REXX_PORT')
  154. exit
  155.  
  156.  
  157. quit: PROCEDURE
  158.    call req_error("Canceled.")
  159.    call req_close()
  160.    call remlib('ToasterARexx.port')
  161.    call remlib('PROJECT_REXX_PORT')
  162.    exit
  163.